/**
 * Copyright (C), 2015-2021, XXX有限公司
 * FileName: MyClassActivity
 * Author: Gxjkz
 * Date: 2021/7/26 13:41
 * Description: wo
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
package com.niuxiaofa.newlaw.Activity;

import androidx.recyclerview.widget.RecyclerView;

import com.niuxiaofa.newlaw.Base.BaseActivity;
import com.niuxiaofa.newlaw.Bean.InviteBean;
import com.niuxiaofa.newlaw.Bean.RankingBean;
import com.niuxiaofa.newlaw.Network.LawUniversalPresenter;
import com.niuxiaofa.newlaw.R;
import com.niuxiaofa.newlaw.Tools.RecyclerViewHelp;
import com.niuxiaofa.newlaw.adapter.MyClassAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * @ClassName: MyClassActivity
 * @Description: java类作用描述
 * @Author: Gxjkz
 * @Date: 2021/7/26 13:41
 */
public class MyClassActivity extends BaseActivity implements LawUniversalPresenter.interface_getInvitePagelist {


    MyClassAdapter myClassAdapter;

    @BindView(R.id.recyclerview)
    RecyclerView recyclerview;

    int current = 1;


    List<InviteBean.DataDTO.PageDTO.RecordsDTO> dtoArrayList = new ArrayList<>();

    @Override
    protected int getLayoutId() {
        return R.layout.activity_myclass;
    }

    @Override
    protected void initData() {

        myClassAdapter = new MyClassAdapter(dtoArrayList, new MyClassAdapter.Onclick() {
            @Override
            public void onclick(int c) {

            }
        });

        RecyclerViewHelp.setRecycler(recyclerview, 0).setAdapter(myClassAdapter);
        LawUniversalPresenter.getInvitePagelist(current, this);


    }


    @Override
    public void getResponse(InviteBean u) {
        if (u.getCode() == 1) {

            dtoArrayList.clear();

            dtoArrayList.addAll(u.getData().getPage().getRecords());
            myClassAdapter.notifyDataSetChanged();
        }
    }


}